#include <QtGui/QApplication>
#include <QMutex>
#include <QPointer>
#include "mainwindow.h"
#include "usbtransfers.h"

// directs qDebug() and friends to the GUI in a nice thhread-safe manner
QPointer<LogBrowser> logBrowser;
void myMessageOutput( QtMsgType type, const char *msg )
{
    if( logBrowser )
    {
        logBrowser->outputMessage( type, msg );
    }
}

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    MainWindow w;

    // not deleting this, but it doesn't matter since the program is done running
    logBrowser = new LogBrowser( &w );

    qInstallMsgHandler( myMessageOutput );
    w.show();
    
    return a.exec();
}
